/*
 * @Description: 构造函数模式
 * @Author: rendc
 * @Date: 2022-10-10 11:21:48
 * @LastEditors: rendc
 * @LastEditTime: 2022-10-10 11:34:58
 */
function Person (name, age, gender) {
  this.name = name;
  this.age = age;
  this.gender = gender;
  this.sayName = function () {
    console.log(this.name);
  }
}

function Dog (name, age, gender) {
  this.name = name;
  this.age = age;
  this.gender = gender;
  this.sayName = function () {
    console.log(this.name);
  }
}
var p1 = new Person("tom", 12, 1);
var p2 = new Person("larry", 22, 2);
p1.sayName()
p2.sayName()
console.log(p1.sayName == p2.sayName); // false
// console.log('🤡 CC - p2', p2);
// var d1 = new Dog("狗子", 22, 2);
// console.log('🤡 CC - d1', d1);
// console.log(p1 instanceof Person); // true
// console.log(d1 instanceof Person); // false
